from rest_framework.serializers import ModelSerializer
from .models import *


class DepaSer(ModelSerializer):
    class Meta:
        model = Department
        fields = '__all__'


class UserSer(ModelSerializer):
    class Meta:
        model = User
        fields = '__all__'


class SUserSer(ModelSerializer):
    depa = DepaSer()

    class Meta:
        model = User
        fields = '__all__'


class BcateSer(ModelSerializer):
    class Meta:
        model = Bcate
        fields = '__all__'


class BookSer(ModelSerializer):
    cate = BcateSer()

    class Meta:
        model = Book
        fields = '__all__'


class SsuserSer(ModelSerializer):
    class Meta:
        model = RedisUser
        fields = '__all__'
